34. Challenger

34. Challenger Example

Failures Regression 1,2,3,4,5,6,7

Regression Formula for a given sample set

$$\begin{aligned} \hat{Y} &= b_0 + b_1X \\ \\ b_1 &= \dfrac{\sum_i (x_i - \overline{x})(y_i - \overline{y})}{\sum_i (x_i - \overline{x})^2} \\ \\ b_0 &= \overline{y} - b_1\overline{x} \end{aligned}$$

In [7]:
x = [70, 57, 63, 70, 53, 75, 58]
y = [1, 1, 1, 1, 2, 2, 1]

sum(x)
Out[7]:
446
In [8]:
sum(y)
Out[8]:
9
In [9]:
sum([i**2 for i in x])
Out[9]:
28816
In [11]:
sum([i[0]*i[1] for i in zip(x,y)])
Out[11]:
574
In [13]:
# means
n = len(x)  # also could use len(Y) as its pairs
x_b, y_b = sum(x)/n, sum(y)/n

b_1 = sum([(i[0] - x_b)*(i[1] - y_b) for i in zip(x,y)])/ sum([(i - x_b)**2 for i in x])
b_0 = y_b - b_1*x_b

b_0, b_1
Out[13]:
(1.1945636623748213, 0.0014306151645207454)

Predicted Failures

Actual expected no of o-ring failures at 36 degrees = ?

In [14]:
36*b_1 + b_0
Out[14]:
1.2460658082975682

All Regression 1,2

In [17]:
n = 23
sum_x, sum_x2, sum_y, sum_xy = 1600, 112400, 9 , 574

b = (sum_xy - (1/n)*sum_x*sum_y)/(sum_x2 - (1/n)*(sum_x)**2)
a = (1/n)*sum_y - b*(1/n)*sum_x
a, b
Out[17]:
(3.6984126984127075, -0.04753968253968267)
In [18]:
36*b + a
Out[18]:
1.9869841269841313